import request from '@/utils/request'

// config
export function inputconfig(data) {
  return request({
    url: '/api/systemconfiguration/inputsource/',
    method: 'post',
    data
  })
}

// 获取目录
export function getfiletree(param) {
  return request({
    url: '/api/systemconfiguration/getfiletree/',
    method: 'get',
    params: param
  })
}

// 更新视频存储路径
export function setvideopath(param) {
  return request({
    url: '/api/systemconfiguration/setvideopath/',
    method: 'post',
    params: param
  })
}

// 更新视频存储路径
export function getvideopath(param) {
  return request({
    url: '/api/systemconfiguration/getvideopath/',
    method: 'get',
    params: param
  })
}

// 更新图片存储路径
export function setimagepath(param) {
  return request({
    url: '/api/systemconfiguration/setimagepath/',
    method: 'post',
    params: param
  })
}

// 更新视频存储路径
export function getimagepath(param) {
  return request({
    url: '/api/systemconfiguration/getimagepath/',
    method: 'get',
    params: param
  })
}

// 获取配置信息
export function getConfig() {
  return request({
    url: '/SystemConfiguration/getConfig',
    method: 'get'
  })
}

// 从后台获取图片
export function capture(param) {
  return request({
    url: '/SystemConfiguration/capture',
    method: 'post',
    data: param
  })
}

// 保存绘制框输入
export function saveInput(param) {
  return request({
    url: '/SystemConfiguration/saveInput',
    method: 'post',
    data: param
  })
}

// 更新阈值
export function updateThreshold(threshold) {
  return request({
    url: '/SystemConfiguration/updateThreshold',
    method: 'post',
    params: {
      threshold: threshold
    }
  })
}

// 更新检测状态
export function updateDetectStatus(status) {
  return request({
    url: '/SystemConfiguration/updateDetectStatus',
    method: 'post',
    params: {
      status: status
    }
  })
}

// 更新视频保存状态
export function updateSaveStatus(status) {
  return request({
    url: '/SystemConfiguration/updateSaveStatus',
    method: 'post',
    params: {
      status: status
    }
  })
}

// 设置视频保存时间
export function updateSaveTimes(cutTime) {
  return request({
    url: '/SystemConfiguration/updateSaveTimes',
    method: 'post',
    params: {
      cutTime: cutTime
    }
  })
}

// 配置源保存
export function updateSource(source) {
  return request({
    url: '/SystemConfiguration/updateSource',
    method: 'post',
    params: {
      source: source
    }
  })
}

// 输入源保存
export function changeInputType(input_type) {
  return request({
    url: '/SystemConfiguration/changeInputType',
    method: 'post',
    params: {
      input_type: input_type
    }
  })
}

// // 删除视频api
// export function deletevideo(param) {
//   return request({
//     url: '/api/imagemodule/uploadvideo/',
//     method: 'delete',
//     params: param
//   })
// }

// // 获取视频资源
// export function playvideo(param) {
//   return request({
//     url: '/api/imagemodule/downloadvideo/',
//     method: 'get',
//     responseType: 'blob',
//     params: param
//   })
// }
